<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<c:set var="disableBtn" value=""/>
<c:if test="${canAddOrUpdate ne true}"><c:set var="disableBtn" value=" disabled='true' "/></c:if>

<c:out value="${param.field_info}" escapeXml="false"/>

<form:form action="allotment.pt" method="POST">
<input type="hidden" name="action_value" id="idActionValue" value="" />

<form:errors path="*" cssClass="error-message"/>

<div class="subheader">Subject Allotment Details:</div>
<table class="input-table">
	<tbody>
		<tr>
			<td width="20%">Tutor<c:out value="${param.field_mandatory}" escapeXml="false"/></td>
			<td width="*">
				<form:select path="tutor" cssClass="element-select">
					<form:option value="" label=""/>
					<form:options items="${tutors}" itemValue="idAsString" itemLabel="name"/>
				</form:select>
			</td>
		</tr>
		<tr>
			<td width="20%">Course</td>
			<td width="*">
				<form:select path="course" onchange="doSubmit('action_course_select')" cssClass="element-select">
					<form:option value="" label=""/>
					<form:options items="${courses}" itemValue="idAsString" itemLabel="name"/>
				</form:select>
			</td>
		</tr>
		<tr>
			<td width="20%">Batch<c:out value="${param.field_mandatory}" escapeXml="false"/></td>
			<td width="*">
				<form:select path="batchYear" cssClass="element-select">
					<form:option value="" label=""/>
					<form:options items="${batches}"/>
				</form:select>
			</td>
		</tr>
		<tr>
			<td width="20%">Course Semester<c:out value="${param.field_mandatory}" escapeXml="false"/></td>
			<td width="*">
				<form:select path="subCourse" onchange="doSubmit('action_semester_select')" cssClass="element-select">
					<form:option value="" label=""/>
					<form:options items="${semesters}" itemValue="idAsString" itemLabel="name"/>
				</form:select>
			</td>
		</tr>
		<tr>
			<td width="20%">Subjects<c:out value="${param.field_mandatory}" escapeXml="false"/></td>
			<td width="*">
				<form:select path="subject" cssClass="element-select">
					<form:option value="" label=""/>
					<form:options items="${subjects}" itemValue="idAsString" itemLabel="name"/>
				</form:select>
			</td>
		</tr>
	</tbody>
</table>

<div class="bottom-btn">
	<input type="button" value="Save" name="action_btn_save" onclick="doSubmit('action_save')" <c:out value="${disableBtn} "/> />
	<input type="button" value="Delete" name="action_btn_delete" onclick="doSubmit('action_delete')"  <c:out value="${disableBtn} "/> />
	<input type="button" value="Cancel" name="action_btn_cancel" onclick="doSubmit('action_cancel')"/>
</div>
</form:form>